/*
 * AnalizeArguments.java
 * 
 * Created on Apr 2, 2009, 11:02:00 PM
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package portfolio.stock.analize;

import libsvm.svm_parameter;

/**
 *
 * @author ACA
 */
public class AnalizeArguments extends svm_parameter implements Cloneable,java.io.Serializable
{
        // Preprocess Arguments
        public boolean        preprocess; //      = true;
        public int            components;//      = 0;
        public int            iterations      = 200;
        static public final String   PREPROCESS_PCA  = "PCA";
        static public final String   PREPROCESS_ICA  = "ICA";
        public String         preprocess_type = null;
        /*********************************************************
	public int svm_type;
	public int kernel_type;
	public double degree;	// for poly
	public double gamma;	// for poly/rbf/sigmoid
	public double coef0;	// for poly/sigmoid

	// these are for training only
	public double cache_size; // in MB
	public double eps;	// stopping criteria
	public double C;	// cost for C_SVC, EPSILON_SVR and NU_SVR
	public int nr_weight;		// for C_SVC
	public int[] weight_label;	// for C_SVC
	public double[] weight;		// for C_SVC
	public double nu;	// for NU_SVC, ONE_CLASS, and NU_SVR
	public double p;	// for EPSILON_SVR
	public int shrinking;	// use the shrinking heuristics
	public int probability; // do probability estimates
         *********************************************************/
        /*
         * 
         */
        public AnalizeArguments ()
        {
            super.cache_size   = 40;
            super.shrinking    = 1;
            super.probability  = 0;
            super.nr_weight    = 0;
            super.weight_label = new int[0];
            super.weight       = new double[0];

            this.preprocess      = false;
            this.preprocess_type = PREPROCESS_ICA;
            this.components      = 0;
            this.iterations   = 200;
            super.svm_type    = 3; //super.EPSILON_SVR 
            super.kernel_type = 2; //super.RBF;
            super.degree      = 3.0;
            super.gamma       = 0;
            super.coef0       = 0;
            super.C           = 1;
            super.nu          = 0.5;
            super.p           = 0.1;
            super.eps         = 0.001;
            //super.shrinking // values 0 & 1
        }
        /**
         * 
         */
        public boolean getPreprocess ()
        {
            return preprocess;
        }
        /**
         * 
         */
        public boolean setPreprocessType (String sType)
        {
            if (PREPROCESS_PCA.equals(sType)) {
                preprocess_type = PREPROCESS_PCA;
                return true;
            }else if (PREPROCESS_ICA.equals(sType)) {
                preprocess_type = PREPROCESS_ICA;
                return true;
            }
            return false;
        }
        /**
         * 
         */
        public String getIterations ()
        {
                int dIterations = this.iterations;
                //Double DIterations = new Double (dIterations);
                Integer DIterations = new Integer (dIterations);
                return DIterations.toString();
        }
        /**
         * 
         */
        public String getDegree ()
        {
                int dDegree = (int) super.degree;
                Integer DDegree = new Integer (dDegree);
                return DDegree.toString();
        }
        /**
         * 
         */
        public String getGamma ()
        {
                double dGamma = super.gamma;
                Double DGamma = new Double (dGamma);
                return DGamma.toString();
        }
        /**
         * 
         */
        public String getCoef0 ()
        {            
                double dCoef0 = super.coef0;
                Double DCoef0 = new Double (dCoef0);
                return DCoef0.toString();
        }
        /**
         * 
         */
        public String getCost ()
        {            
                int dCost = (int) super.C;
                Integer DCost = new Integer (dCost);
                return DCost.toString();
        }
        /**
         * 
         */
        public String getNu ()
        {            
                double dNu = super.nu;
                Double DNu = new Double (dNu);
                return DNu.toString();
        }
        /**
         * 
         */
        public String getEpsilonSVRLoss ()
        {            
                double dP = super.p;
                Double DP = new Double (dP);
                return DP.toString();
        }
        /**
         * 
         */
        public String getEpsilonTolerance ()
        {            
                double dEps = super.eps;
                Double DEps = new Double (dEps);
                return DEps.toString();
        }
        /**
         * 
         */
//        public int getKErnelType ()
//        {
//            return super.kernel_type;
//        }
}
